﻿using IOA.MES.Business;
using IOA.MES.DataAccess.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace IOA.MES.Web.Controllers
{
    public class WmsController : Controller
    {
        /// <summary>
        /// 入库任务
        /// </summary>
        public ActionResult WmsInboundTask()
        {
            ViewBag.Workshops = new WorkshopMgr().QueryUserWorkshops(BaseEnv.UserId);
            ViewBag.InboundTaskStatuses = new CommonMgr().QueryEnumTypes(typeof(WmsInboundStatus));
            return View();
        }

        /// <summary>
        /// 查询入库任务记录
        /// </summary>
        [HttpPost]
        public JsonResult QueryWmsInboundTasks(int page, int limit, string workshopCode, WmsInboundStatus? status, DateTime startTime, DateTime endTime,
            string orderNo, string workOrderNo, string cabinetNo, string packNo)
        {
            //var result = new WmsMgr().QueryWmsInboundTasks(page, limit, workshopCode, status, startTime, endTime, orderNo, workOrderNo, cabinetNo, packNo);
            //return Json(new ResultJson<object>(result.Item2, result.Item1));
            return Json(new ResultJson<object>());
        }

        /// <summary>
        /// 入库明细
        /// </summary>
        public ActionResult WmsInboundTaskItems(string inboundNo)
        {
            //ViewBag.TaskItems = new WmsMgr().QueryWmsInboundTaskItems(inboundNo);
            return View();
        }

        /// <summary>
        /// 重试入库
        /// </summary>
        [HttpPost]
        public JsonResult RetryWmsInboundTask(string inboundNo)
        {
            //new WmsMgr().RetryWmsInboundTask(inboundNo);
            return Json(new ResultJson<object>());
        }
    }
}
